<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
	<title>管理员管理</title>
	<link rel="stylesheet" type="text/css" href="css/css.css" />
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<!-- <script type="text/javascript" src="js/page.js" ></script> -->
</head>
<body>
	<div id="pageAll">
		<div class="pageTop">
			<div class="page">
				<img src="img/coin02.png" /><span><a href="#">首页</a>&nbsp;-&nbsp;-</span>&nbsp;教室管理
			</div>
		</div>

		<div class="page">
			<!-- user页面样式 -->
			<div class="connoisseur">
				<div class="conform">
						<div class="cfD">
							<form action="classroom/queryByPage" method="get" id="pager">
							<button id="add" type="button" class="userbtn">添加教室</button>
							<input type="hidden" name="currentPage" id="currentPage" value="${pageModel.currentPage }">
    						<input type="hidden" name="pageSize" id="pageSize" value="${pageModel.pageSize }">
							<input class="userinput" name="cnumber" type="text" placeholder="教室名称" value="${cn }"/>
							<input type="submit" class="userbtn">
							</form>
						</div>
				</div>
				<!-- user 表格 显示 -->
				<div class="conShow">
					<table border="1" cellspacing="0" cellpadding="0">
						<tr>
							<td width="66px" class="tdColor tdC">序号</td>
							<td width="435px" class="tdColor">详细位置</td>
							<td width="400px" class="tdColor">教室名称</td>
							<td width="630px" class="tdColor">教室类别</td>
							<td width="130px" class="tdColor">操作</td>
						</tr>
						<c:forEach items="${pageModel.result }" var="cr">
						<tr height="40px">
							<td>${cr.cid }</td>
							<td>${cr.cbuildname }</td>
							<td>${cr.cnumber }</td>
							<td>${cr.ctype }</td>
							<td><a href="classroom/queryById?cid=${cr.cid }"><img class="operation"
									src="img/update.png"></a> <img class="operation delban"
							 info="${cr.cid }" src="img/delete.png"></td>
						</tr>
						</c:forEach>
					</table>
					<div class="paging">
						<%@ include file="/pageBar.jsp" %>
					</div>
				</div>
				<!-- user 表格 显示 end-->
			</div>
			<!-- user页面样式end -->
		</div>

	</div>


	<!-- 删除弹出框 -->
	<div class="banDel">
		<div class="delete">
			<div class="close">
				<a><img src="img/shanchu.png" /></a>
			</div>
			<p class="delP1">你确定要删除此条记录吗？</p>
			<p class="delP2">
				<a href="##" id="sure" class="ok yes">确定</a><a class="ok no">取消</a>
			</p>
		</div>
	</div>
	<!-- 删除弹出框  end-->
</body>

<script type="text/javascript">
// 广告弹出框
$(".delban").click(function(){
	var a=$(this).attr("info");
	var url="classroom/delete?cid="+a;
	$("#sure").attr("href",url);
  $(".banDel").show();
});
$("#add").click(function(){
	window.location.href="classroom/classroom_add.jsp";

});
$(".close").click(function(){
  $(".banDel").hide();
});
$(".no").click(function(){
  $(".banDel").hide();
});

// 广告弹出框 end
</script>
</html>